<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - find_optimal_parameters_abstract.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2016  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#undef</font> DLIB_fIND_OPTIMAL_PARAMETERS_ABSTRACT_Hh_
<font color='#0000FF'>#ifdef</font> DLIB_fIND_OPTIMAL_PARAMETERS_ABSTRACT_Hh_

<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../matrix.h.html'>../matrix.h</a>"

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font>
        <font color='#0000FF'>typename</font> funct
        <font color='#5555FF'>&gt;</font>
    <font color='#0000FF'><u>double</u></font> <b><a name='find_optimal_parameters'></a>find_optimal_parameters</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'><u>double</u></font> initial_search_radius,
        <font color='#0000FF'><u>double</u></font> eps,
        <font color='#0000FF'>const</font> <font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>int</u></font> max_f_evals,
        matrix<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>0</font>,<font color='#979000'>1</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> x,
        <font color='#0000FF'>const</font> matrix<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>0</font>,<font color='#979000'>1</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> x_lower,
        <font color='#0000FF'>const</font> matrix<font color='#5555FF'>&lt;</font><font color='#0000FF'><u>double</u></font>,<font color='#979000'>0</font>,<font color='#979000'>1</font><font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> x_upper,
        <font color='#0000FF'>const</font> funct<font color='#5555FF'>&amp;</font> f
    <font face='Lucida Console'>)</font>;
    <font color='#009900'>/*!
        requires
            - f(x) must be a valid expression that evaluates to a double
            - x.size() == x_lower.size() == x_upper.size()
            - x.size() &gt; 0
            - 0 &lt; eps &lt; initial_search_radius 
            - max_f_evals &gt; 1
            - min(x_upper - x_lower) &gt; 0 
            - min(x - x_lower) &gt;= 0 &amp;&amp; min(x_upper - x) &gt;= 0
              (i.e. the given x should be within the bounds defined by x_lower and x_upper)
        ensures
            - Performs a constrained minimization of the function f() starting from 
              the initial point x.  
            - This function does not require derivatives of f().  Instead, it uses
              derivative free methods to find the best setting of x.  In particular, it
              will begin by searching within a sphere of radius initial_search_radius
              around x and will continue searching until either f() has been called
              max_f_evals times or the search area has been shrunk to less than eps radius.
            - #x == the value of x (within the bounds defined by x_lower and x_upper) that 
              was found to minimize f().  More precisely, it will always be true that:
                - min(#x - x_lower) &gt;= 0 &amp;&amp; min(x_upper - #x) &gt;= 0
            - returns f(#x). 
        throws
            - No exception is thrown for executing max_f_evals iterations.  This function
              will simply output the best x it has seen if it runs out of iterations.
    !*/</font>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_fIND_OPTIMAL_PARAMETERS_ABSTRACT_Hh_
</font>


</pre></body></html>